1 From 9e8243025cc06abc975c876dffda052073207ab3 Mon Sep 17 00:00:00 2001
2 From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
3 Date: Tue, 4 Feb 2025 20:37:36 +0200
4 Subject: [PATCH] wifi: rtw88: Fix download_firmware_validate() for RTL8814AU
6 After the firmware is uploaded, download_firmware_validate() checks some
7 bits in REG_MCUFW_CTRL to see if everything went okay. The
8 RTL8814AU power on sequence sets bits 13 and 12 to 2, which this
9 function does not expect, so it thinks the firmware upload failed.
11 Make download_firmware_validate() ignore bits 13 and 12.
13 Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
14 Acked-by: Ping-Ke Shih <pkshih@realtek.com>
15 Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
16 Link: https://patch.msgid.link/049d2887-22fc-47b7-9e59-62627cb525f8@gmail.com
18 drivers/net/wireless/realtek/rtw88/reg.h | 3 ++-
19 1 file changed, 2 insertions(+), 1 deletion(-)
21 --- a/drivers/net/wireless/realtek/rtw88/reg.h
22 +++ b/drivers/net/wireless/realtek/rtw88/reg.h
24 #define BIT_SHIFT_ROM_PGE 16
25 #define BIT_FW_INIT_RDY BIT(15)
26 #define BIT_FW_DW_RDY BIT(14)
27 +#define BIT_CPU_CLK_SEL (BIT(12) | BIT(13))
28 #define BIT_RPWM_TOGGLE BIT(7)
29 #define BIT_RAM_DL_SEL BIT(7) /* legacy only */
30 #define BIT_DMEM_CHKSUM_OK BIT(6)
33 #define FW_READY_LEGACY (BIT_MCUFWDL_RDY | BIT_FWDL_CHK_RPT | \
34 BIT_WINTINI_RDY | BIT_RAM_DL_SEL)
35 -#define FW_READY_MASK 0xffff
36 +#define FW_READY_MASK (0xffff & ~BIT_CPU_CLK_SEL)
38 #define REG_MCU_TST_CFG 0x84
39 #define VAL_FW_TRIGGER 0x1